package com.xmutca.cloud.auth.security;

import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.AuthenticationFailureBadCredentialsEvent;
import org.springframework.stereotype.Service;

/**
 * 登陆失败处理器
 * @author: weihuang.peng
 * @version Revision: 0.0.1
 * @Date: 19 Feb,2017
 */
@Service
public class SecurityFailureListener implements ApplicationListener<AuthenticationFailureBadCredentialsEvent> {

	@Override
	public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent event) {
		System.out.println(String.format("用户名或者密码错误事件: %s", event.getAuthentication().getName()));
	}
}
